﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SuperMap.HB.ThemeWork
{
    public partial class SelectFieldForm : Form
    {
        public List<string> Fields
        {
            set
            {
                try
                {
                    cmb_Lat.Items.Clear();
                    cmb_Lon.Items.Clear();
                    cmb_Lat.Items.AddRange(value.ToArray());
                    cmb_Lon.Items.AddRange(value.ToArray());
                    if (cmb_Lat.Items.Count > 0)
                    {
                        cmb_Lat.SelectedIndex = 0;
                    }
                    if (cmb_Lon.Items.Count > 0)
                    {
                        cmb_Lon.SelectedIndex = 0;
                    }
                }
                catch (Exception ex)
                {
                    Log.OutputBox(ex);
                }
            }
        }

        public string LonName => cmb_Lon.Text;

        public string LatName => cmb_Lat.Text;

        public SelectFieldForm()
        {
            InitializeComponent();
        }

        private void btn_OK_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult = DialogResult.OK;
            }
            catch (Exception ex)
            {
                Log.OutputBox(ex);
            }
        }
    }
}
